<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.shsh.safemanage.model.User"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.UserDao"%>

<script type="text/javascript">
var userIDList = [];
var count = 0;
</script>

<%
{
UserDao theUserDao = DaoCreator.createUserDao();
String manageGroupIDStr = request.getParameter(Constants.REQUEST_PARAMETER_MANAGEGROUP_ID);
Long manageGroupID = 0L;
try {
	manageGroupID = new Long(manageGroupIDStr);
} catch (Exception e) {
}

User theUser = (User) session.getAttribute(Constants.SESSION_USER);

List<User> userList = theUserDao.getManageGroupMappingUserList(manageGroupID, theUser.getDepartment1ID());
%>
<table width="90%" style="margin-left: 40px">
<%
boolean isBreak = false;
for (int i = 0; i < 1000; i++) {
%>
<tr>
<%
	for (int j = 0; j < 8; j++) {
		int index = i * 8 + j;
		if (index >= userList.size()) {
			isBreak = true;
			break;
		}
		
		User manageGroupUser = userList.get(index);
%>
	<td>
	<input type="checkbox" value="<%=manageGroupUser.getId()%>" id="manageGroupUserCheck<%=manageGroupUser.getId()%>" /> <%=manageGroupUser.getName()%>
	<script type="text/javascript">
	userIDList[count++] = <%=manageGroupUser.getId()%>
	</script>
	</td>
<%
	}
	if (isBreak) {
		break;
	}
%>
</tr>
<%
}
%>
</table>
<%
}
%>